package com.dk.controller;

import com.dk.model.Scheduld;
import com.dk.service.ReportService;
import com.dk.service.ScheduldService;
import com.dk.vo.EchartsVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;


@Controller
@RequestMapping("echars")
@CrossOrigin
public class EcharsController {

    @RequestMapping("test")
    public String test(){
        return "test";
    }
    @Autowired
    private ReportService reportService;

    @RequestMapping("/show/{flag}")
    @ResponseBody
    public List<EchartsVO> show(@PathVariable(value = "flag") Integer flag) {
        List<EchartsVO> echartsList = reportService.getInfoToEchers(flag);
        return echartsList;
    }
}
